1. Field of the Invention
The present invention is generally related to image processing, and more particularly, to a stream-based bitrate transcoder for MPEG bitstreams.
2. Description of the Prior Art
Bitrate transcoding is a very powerful tool to adapt the dynamic bitrate changes in networked multimedia applications, especially in a heterogeneous networks environment such as circuit switched, asynchronous transfer mode (ATM), mobile and internet. To provide video services in a wide range of bitrate requirements from a very low bitrate of few that 64 Kbps to HDTV quality video with more than 20 Mbps, the bitrate transcoding provides an efficient alternative with less complexity to accommodate these requirements.
To perform the bitrate transcoding, one simple but inefficient approach is to fully decode the input bitstream and re-encode it at the new target bitrate. The drawbacks of this brute force approach are its intensive computational overheads (i.e., a more powerful CPU is needed) and significant video quality loss due to its re-quantization.
Generally speaking, video bitrate transcoding may be categorized into two groups, specifically, open-loop transcoding, as illustrated in FIG. 1 with a data partitioning approach, and closed-loop transcoding, as illustrated in FIG. 2, with a decoding-re-encoding approach.
In open-loop methods, the goal is to minimize transcoding complexity, and thus, only the encoded DCT coefficients are modified to reduce the overall bitrate. The effect of the drift introduced by coefficients dropping causes continuous drop of picture quality over predicted frame (P) due to error accumulation in the decoder""s loop. The accumulated drift error is reset to zero whenever an intra-frame (I) is decoded.
In contrast, closed-loop transcoding needs a re-encoding system such that the input bitstream is fully decoded into the pixel domain and encoded again at a lower bitrate. With a feedback loop, the transcoding distortion is corrected and does not propagate into successive frames. This is regarded as a desirable solution in terms of coding efficiency, although it is the most complex and costly option, especially if the encoder runs independently from the input decoder. A cascade of decoder-encoder is an example of a closed-loop transcoder.
The present invention provides a stream based bitrate transcoder for MPEG bitstreams. By utilizing the information extracted from MPEG bitstreams, such as picture-type, coding complexity, motion vector, and MB-mode, a stream-based bitrate conversion algorithm with much less complexity is realized. The present invention drops DCT coefficients with regard to two components, specifically, picture/MB-level classification and motion reference calculation. The present inventive transcoding schemes are not limited to MPEG bitstreams and is applicable to any DCT coded video bitstream containing information, such as picture type and MB mode, e.g., H.263 coded video.
A method of video bitrate transcoding in accordance with the present invention include extracting information comprising the motion vectors and picture-microblock type for all frames in a GOP from a bit stream.
The method further includes calculating a number of bits from encoding discrete cosine transform (DCT) coefficients by VLC decoding and transforming the bitstream into a DCT bitstream. A bitrate is determined and DCT coefficients dropped based upon the information in order to achieve the bitrate difference in the DCT bitstream.
A further aspect of the present invention, the method also includes using a TM5 rate control to ensure the bitrate difference is achieved.
In accordance with a further aspect of the present invention, the bitstream is a MPEG bitstream.
In accordance with another aspect of the present invention, the method further includes pre-analyzing the bitstream by parsing the bitstream and calculating coding complexity for the DCT bitstream.
In accordance with a further aspect of the present invention, the bitrate difference is achieved by proportionally distributing DCT coefficients to be dropped among an anchor frame, a predicted frame and a blck frame.
In accordance with yet another aspect of the present invention, the priority for proportionally distributing the DCT coefficients to be dropped is anchor frame less than predicted frame less than block frame.
Reference to the remaining portions of the specification, including the drawings and claims, will realize other features and advantages of the present invention. For the features and advantages of the present invention, as well as the structure and operation of various embodiments of the present invention, are described in detail below with respect to the accompanying drawings.